<?php
    $categoryList = ns_dao_software::GetCategoryList();
    $userList = ns_dao_user::GetUsersList();
?>
    <form name="updateSoftware" action="my_projects.php" method="POST" onsubmit="return check_software_form()">
    <input type="hidden" name="softwareID" id="softwareID" value="<?php echo $_GET['id'] ?>"/>
    <table width="100%" cellspacing="1" cellpadding="1">
        <tr>
            <td colspan="2"><strong>Software Item</strong></td>
        </tr>
        <tr>
            <td nowrap="nowrap" valign="top" width="10%">
                <font size="-1">Name:</font>
            </td>
            <td>
                <input name="Name" id="Name" size="30" value="" type="text">
            </td>
        </tr>
        <tr>
            <td nowrap="nowrap" valign="top" width="10%">
                <font size="-1">Description:</font>
            </td>
            <td>
                <textarea name="Description" id="Description" rows="10" cols="50"></textarea>
            </td>
        </tr>                
        <tr>
            <td nowrap="nowrap" valign="top" width="10%">
                <font size="-1">Category:</font>
            </td>
            <td>
                <select name="Category" id="Category">
                <?php
                    foreach ($categoryList as $key => $category)
                    {
                        echo '<option value="' . $category->ID() . '">' . $category->ID() . " - " . $category->CategoryDescription() . "</option>";
                    }
                ?>
                </select>                        
            </td>
        </tr>
        <tr>
            <td nowrap="nowrap" valign="top" width="10%">
                <font size="-1">Owner:</font>
            </td>
            <td>
                <select name="Owner" id="Owner">
                <?php
                    echo '<option value="' . $_SESSION['username'] . '">' . $_SESSION['username'] . "</option>";
                ?>  
                </select>                        
            </td>
        </tr>
        <tr>
            <td nowrap="nowrap" valign="top" width="10%">
                <font size="-1">Approved:</font>
            </td>
            <td>
                <input type="radio" name="Approved" id="Not Approved" value="0" checked="checked" />Not Approved<br />
                <input type="radio" name="Approved" id="Approved" value="1" disabled="disabled" />Approved                        
            </td>
        </tr>
        <tr>
            <td colspan="1">&nbsp;</td>
            <td style="" align="left" nowrap="nowrap">
            <input type="submit" name="createSoftware" id="createSoftware" value="Save" style="font-weight: bold;" />
            <input type="button" name="cancel" id="cancel" value="Cancel" onclick="window.location.href ='my_projects.php'" />
            </td>
        </tr>
    </table>
    </form><br /><br />